package cn.duli.xianer.service.impl;

import cn.duli.xianer.dao.FollowMapper;
import cn.duli.xianer.pojo.Follow;
import cn.duli.xianer.service.FollowService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class FollowServiceImpl implements FollowService {

    @Resource
    private FollowMapper followMapper;

    @Override
    public int save(Follow follow) {
        followMapper.save(follow);
        return follow.getfId();
    }

    @Override
    public void deleteById(Integer fId) {
        followMapper.deleteById(fId);
    }

    @Override
    public List<Follow> findByCurrId(Integer fCurrentUid) {
        return followMapper.findByCurrId(fCurrentUid);
    }

    @Override
    public List<Follow> findByUserId(Integer fUid) {
        return followMapper.findByUserId(fUid);
    }

    @Override
    public int findFollowCount(Integer fCurrentUid) {
        return followMapper.findFollowCount(fCurrentUid);
    }

    @Override
    public int findFansCount(Integer fUid) {
        return followMapper.findFansCount(fUid);
    }
}
